import axios from '../libs/api.request'

// 查询所有组织架构list
export function queryAllOrgList () {
  return axios.request({
    url: '/ids/security/org/tree.json'
  })
}

// 新增部门机构
export function addOrg (params) {
  return axios.request({
    method: 'POST',
    url: '/ids/security/org/add.json',
    data: params
  })
}

// 查询机构详情
export function queryOrgInfo (code) {
  return axios.request({
    url: `/ids/security/org/detail.json?deptCode=${code}`
  })
}

// 修改部门机构
export function editOrg (params) {
  return axios.request({
    method: 'PUT',
    url: '/ids/security/org/edit.json',
    data: params
  })
}

// 删除部门机构
export function deleteOrg (code) {
  return axios.request({
    method: 'DELETE',
    url: `/ids/security/org/remove.json?deptCode=${code}`
  })
}
